from django.utils.deprecation import MiddlewareMixin

class MD1(MiddlewareMixin):
    def process_request(self,request):
        print("md1 process_request") # 在视图函数之前执行